

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1"><title>

</title><link href='./home/css/etm.css' rel='stylesheet' type='text/css' /><!--[if IE 8]> <link href='/Themes/Theme3/ie8Fix.css' rel='stylesheet' /> <![endif]-->

    <script src="./home/js/DatePicker/WdatePicker.js"></script>
    <script src="./home/js/jquery-1.4.2.min.js"></script>
    <script src="./home/js/jQuery.Ex.js"></script>
    <script src="./home/js/Validator.js"></script>
    <meta http-equiv="X-UA-Compatible" content="IE=11; IE=10; IE=9; IE=8; IE=7; IE=EDGE"/><script src='./home/js/jquery.nicescroll.min.js' type='text/javascript'></script><script type='text/javascript'>var isEtmClient=false;function ReSizeScrollbar() { if ($('form').getNiceScroll().length > 0) {     $('form').getNiceScroll().onResize();}}function ReSizeFlexgridScrollbar() { if ($('.bDiv').getNiceScroll().length > 0) {     $('.bDiv').getNiceScroll().onResize();}}function InitFlexgridScrollbar(){     $('.bDiv').niceScroll({cursorcolor: '#75A801',zindex:4});}function ReSizenDivScrollbar() { if ($('.flexigrid .nDiv').getNiceScroll().length > 0) {     $('.flexigrid .nDiv').getNiceScroll().onResize();}}function InitnDivScrollbar(){     $('.flexigrid .nDiv').niceScroll({cursorcolor: '#75A801',horizrailenabled:false});}function proxyExecuteFun(funName) {if(funName == undefined || funName==null|| funName.length==0){window.parent.showsending(true, "执行中，请耐心等待");setTimeout(function() { window.parent.showsending(false); }, 5000);return;}  if (window[funName]()) {window.parent.showsending(true, "执行中，请耐心等待");setTimeout(function() { window.parent.showsending(false); }, 5000);return true; } return false; };var _tmpOnSelectedFile = null;function onSelectedFile(fileName, fileUrl, isImg) {   if (_tmpOnSelectedFile != null) {        _tmpOnSelectedFile(fileName, fileUrl, isImg);    }}function showFileList(callback) {   window.parent.showDialog('查看素材库', '/Modules/OA/CMyFileListView.aspx?navId=be5af13f-a3ec-4c07-bb79-9cd73b912f13', '900px', '450px');   _tmpOnSelectedFile = callback;}$(function () {if (navigator.userAgent.toLowerCase().indexOf('edge/') != -1) { $('input[type=submit],.tmpSubmitButton').bind({ mouseenter: function () { $(this).addClass('tmpSubmitButton'); $(this).prop('type', 'button'); }, mouseleave: function () { $(this).removeClass('tmpSubmitButton'); $(this).prop('type', 'submit'); }, click: function () { $(this).removeClass('tmpSubmitButton'); $(this).prop('type', 'submit'); } }); }if (window.parent != undefined && window.parent != null && typeof window.parent.showsending != "undefined") { window.parent.showsending(false, ''); }$(".button").each(function() { if ($(this).attr("type") == "submit" &&!$(this).hasClass('noloading') && window.parent != undefined && window.parent != null && typeof window.parent.showsending != "undefined") { var tmpClick = $(this).attr("onclick");if(tmpClick == undefined || tmpClick==null|| tmpClick.length<2){ $(this).attr("onclick","proxyExecuteFun();");return;}  if (tmpClick.indexOf("return ") != -1 && tmpClick.indexOf("(") != -1) { tmpClick = tmpClick.substring(7).replace(/\s+/g, ''); if (tmpClick.indexOf("()") != -1) { var funName = tmpClick.substring(0, tmpClick.indexOf("(")); $(this).attr("onclick","return proxyExecuteFun('" + funName + "');"); } } } });$('body').click(function() {     if (typeof parent.onChildPageClick !='undefined') {         parent.onChildPageClick();     }});     $('form').height($(window).height()-0).niceScroll({cursorcolor: '#75A801',horizrailenabled:false });     $(window).resize(function () {         ReSizeScrollbar();     });});</script>
    <style type="text/css">
        ul {
            list-style: none;
            padding-left: 0px;
        }

            ul li {
                float: left;
                padding: 1px 2px 1px 5px;
                margin: 2px 10px 2px 0px;
                border: 1px solid #ccc;
                background-color: #fff;
                height: 22px;
                line-height: 22px;
                font-size: 12px;
            }
    </style>
    <script type="text/javascript">
        navId = 'be5af13f-a3ec-4c07-bb79-9cd73b912f13';
        function selectMember(navId) {
            window.parent.showDialog("选择幼儿", "../Modules/CRM/SelectMultiMembers.aspx?navId=" + navId + "&memberType=1&act=tuitionin", "1000px", "550px");
        }
        function AddMemberInfo(memberGuid, memberName, depositGuid, amount) {
            var hfInfo = $("#hfMember").val();
            if (hfInfo != "") {
                jsonObjList = jQuery.parseJSON(hfInfo);
            }
            else {
                jsonObjList = [];
            }
            var isExist = false;
            for (var i = 0; i < jsonObjList.length; i++) {
                if (memberGuid.toLocaleLowerCase() == jsonObjList[i].MemberGuid.toLocaleLowerCase()) {
                    isExist = true;
                }
            }

            if (isExist) {
                parent.parent.ShowTips("该幼儿已添加");
            }
            else {
                jsonObjList.push({ "MemberGuid": memberGuid, "MemberName": memberName, "DepositGuid": depositGuid, "Amount": amount });
                $("#hfMember").val(JSON.stringify(jsonObjList));
                BindMember();
                parent.parent.ShowTips("添加成功");
            }
        }
        function AddMemberInfo_Multi(data) {
            var hfInfo = $("#hfMember").val();
            if (hfInfo != "") {
                jsonObjList = jQuery.parseJSON(hfInfo);
            }
            else {
                jsonObjList = [];
            }
            var tJson = jQuery.parseJSON(data);
            var isExist = false;
            for (var i = 0; i < tJson.length; i++) {
                isExist = false;
                for (var j = 0; j < jsonObjList.length; j++) {
                    if (tJson[i].MemberGuid.toLocaleLowerCase() == jsonObjList[j].MemberGuid.toLocaleLowerCase()) {
                        isExist = true;
                    }
                }
                if (!isExist) {
                    jsonObjList.push({ "MemberGuid": tJson[i].MemberGuid, "MemberName": tJson[i].MemberName, "DepositGuid": tJson[i].DepositGuid, "Amount": tJson[i].Amount });
                }
            }
            $("#hfMember").val(JSON.stringify(jsonObjList));
            BindMember();
            parent.parent.ShowTips("添加成功");
        }
        function DeleteMember(memberGuid) {
            var hfInfo = $("#hfMember").val();
            if (hfInfo != "") {
                jsonObjList = jQuery.parseJSON(hfInfo);
            }
            else {
                jsonObjList = [];
            }
            for (var i = 0; i < jsonObjList.length; i++) {
                if (jsonObjList[i].MemberGuid.toLocaleLowerCase() == memberGuid.toLocaleLowerCase()) {
                    jsonObjList.splice(i, 1);
                }
            }
            $("#hfMember").val(JSON.stringify(jsonObjList));
            BindMember();
        }
        function BindMember() {
            var hfInfo = $("#hfMember").val();
            if (hfInfo != "") {
                jsonObjList = jQuery.parseJSON(hfInfo);
            }
            else {
                jsonObjList = [];
            }

            var html = "<ul>";
            for (var i = 0; i < jsonObjList.length; i++) {
                var memberName = jsonObjList[i].MemberName;
                if (jsonObjList[i].DepositGuid != "00000000-0000-0000-0000-000000000000") {
                    memberName += "（定金：" + jsonObjList[i].Amount + "）";
                }
                html += "<li>";
                html += memberName;
                html += "<a title=\"取消\" onclick=\"DeleteMember('" + jsonObjList[i].MemberGuid + "')\" href=\"javascript:void(0)\" title=\"删除\"><img style=\"vertical-align:middle;\" src=\"../../Images/del.png\"></a>"
                //html += "<span style=\"padding-right:15px;\">" + memberName;
                //html += "<span ><a title=\"取消\" onclick=\"DeleteMember('" + jsonObjList[i].MemberGuid + "')\" href=\"javascript:void(0)\"><img style=\"vertical-align:middle;\" src=\"../../Images/del.png\"></a></span>";
                //html += "</span>";
                html += "</li>";
            }
            html += "</ul>";
            $("#dvMember").html(html);
            if ($("#dvMember li").size() == 0) {
                $("#btnAddMember").css("top", "10px");
            } else {
                $("#btnAddMember").css("top", "18px");
            }
            //$("#lbMember").html(html);
        }

        function selectTuitionItem(navId) {
            var EffectiveLen = "M";
            if ($("#rdbTimeStepM").is(':checked')) {
                EffectiveLen = "M";
            }
            else if ($("#rdbTimeStepT").is(':checked')) {
                EffectiveLen = "T";
            }
            else {
                EffectiveLen = "Y";
            }
            window.parent.showDialog("选择收费科目", "../Modules/Finance/SelectTuitionItem.aspx?navId=" + navId + "&EffectiveLen=" + EffectiveLen, "760px", "420px");
        }
        function AddTuitionItem(Items) {
            if (Items != null && Items != "") {
                var discount = "1.00";
                if ($.trim($("#txtDiscount").val()) != "")
                    discount = $.trim($("#txtDiscount").val());

                var hfInfo = $("#hfTuitionItemData").val();
                if (hfInfo != "") {
                    jsonObjList = jQuery.parseJSON(hfInfo);
                }
                else {
                    jsonObjList = [];
                }
                var jsonItemList = jQuery.parseJSON(Items);

                var isExist = false;
                for (var i = 0; i < jsonObjList.length; i++) {
                    if (jsonObjList[i].TuitionItemGuid.toLocaleLowerCase() == jsonItemList[0].TuitionItemGuid.toLocaleLowerCase()) {
                        isExist = true;
                    }
                }
                if (isExist) {
                    parent.parent.ShowTips("该科目已添加");
                }
                else {
                    if (jsonItemList[0].IsDiscount == "True" || jsonItemList[0].IsDiscount == "true" || jsonItemList[0].IsDiscount == "1") {
                        jsonObjList.push({ MemberTuitionItemGuid: "00000000-0000-0000-0000-000000000000", MemberTuitionGuid: "00000000-0000-0000-0000-000000000000", TuitionItemGuid: jsonItemList[0].TuitionItemGuid, TuitionCriterionGuid: jsonItemList[0].TuitionCriterionGuid, ItemName: jsonItemList[0].ItemName, ItemPrice: jsonItemList[0].ItemPrice, ItemCount: 1, ItemType: 1, ItemAmount: (Number(jsonItemList[0].ItemPrice)).toFixed(2), Discount: discount, ActualAmount: (Number(jsonItemList[0].ItemPrice) * (Number(discount))).toFixed(2), IsDiscount: jsonItemList[0].IsDiscount, EffectiveLen: jsonItemList[0].EffectiveLen });
                    }
                    else {
                        jsonObjList.push({ MemberTuitionItemGuid: "00000000-0000-0000-0000-000000000000", MemberTuitionGuid: "00000000-0000-0000-0000-000000000000", TuitionItemGuid: jsonItemList[0].TuitionItemGuid, TuitionCriterionGuid: jsonItemList[0].TuitionCriterionGuid, ItemName: jsonItemList[0].ItemName, ItemPrice: jsonItemList[0].ItemPrice, ItemCount: 1, ItemType: 1, ItemAmount: (Number(jsonItemList[0].ItemPrice)).toFixed(2), Discount: "1.00", ActualAmount: (Number(jsonItemList[0].ItemPrice) * (Number(1.00))).toFixed(2), IsDiscount: jsonItemList[0].IsDiscount, EffectiveLen: jsonItemList[0].EffectiveLen });
                    }
                    $("#hfTuitionItemData").val(JSON.stringify(jsonObjList));
                    BindItem();
                    parent.parent.ShowTips("添加成功");
                }

            }

        }
        function BindItem() {
            var hfInfo = $("#hfTuitionItemData").val();
            if (hfInfo != "") {
                jsonItemList = jQuery.parseJSON(hfInfo);
            }
            else {
                jsonItemList = [];
            }
            var trHtml = '';
            for (var i = 0; i < jsonItemList.length; i++) {
                trHtml += '<tr>';
                trHtml += '<td>' + jsonItemList[i].ItemName + '</td>';
                trHtml += '<td style="text-align:right;">' + (Number(jsonItemList[i].ItemPrice)).toFixed(2) + '</td>';
                if (jsonItemList[i].IsDiscount.toString() == "True" || jsonItemList[i].IsDiscount.toString() == "true" || jsonItemList[i].IsDiscount.toString() == "1") {

                    trHtml += '<td><input type="text" name="tbDiscountTrue" value="' + (Number(jsonItemList[i].Discount)).toFixed(2) + '" class="int tbTuitionItemDiscount" style="width:60px;text-align:right;" /></td>';
                }
                else {
                    trHtml += '<td><input type="text" name="tbDiscount" disabled="true" value="' + (Number(jsonItemList[i].Discount)).toFixed(2) + '" class="int tbTuitionItemDiscount" style="width:60px;text-align:right;" /></td>';
                }
                trHtml += '<td style="text-align:right;"><input type="text" name="tbItemAmount" value="' + jsonItemList[i].ItemAmount + '" class="int tbTuitionItemAmount" style="width:60px;text-align:right;"/></td>';
                trHtml += '<td style="text-align:right;">' + jsonItemList[i].ActualAmount + '</td>';
                trHtml += '<td><a href="javascript:void(0)" title="删除" class="deleteTuitionItem"><img src="../../Images/del_c.png" /></a>';
                trHtml += '<input type="hidden" name="hfTuitionItemGuid" value=\'' + jsonItemList[i].TuitionItemGuid + '\' />';
                trHtml += '</td>';
                trHtml += '</tr>';
            }
            $("#TuitionItemList tbody").html(trHtml);
            ItemAutoCompute();
        }
        function ItemAutoCompute() {
            var subTotal = 0, discountSubTotal = 0;
            $("#TuitionItemList tbody tr").each(function () {
                var itemAmount = Number($(this).children().eq(3).find("input").val());
                var itemDiscount = Number($(this).children().eq(2).find("input").val());
                $(this).children().eq(4).text((itemAmount * itemDiscount).toFixed(2));
                subTotal += itemAmount;
                discountSubTotal += itemAmount * itemDiscount;
            });
            $("#lbTuitionItemTotal").text(subTotal.toFixed(2));
            $("#lbTuitionItemDiscountTotal").text(discountSubTotal.toFixed(2));
            ColAmount();
            ReSizeScrollbar();
        }
        function ColAmount() {
            var totalAmount = 0;
            var actualAmount = 0;
            if (isNaN(parseFloat($("#lbLessonDiscountTotal").html())))
                actualAmount += parseFloat(0);
            else
                actualAmount += parseFloat($("#lbLessonDiscountTotal").html());

            if (isNaN(parseFloat($("#lbTuitionItemDiscountTotal").html())))
                actualAmount += parseFloat(0);
            else
                actualAmount += parseFloat($("#lbTuitionItemDiscountTotal").html());

            if (isNaN(parseFloat($("#lbProductDiscountTotal").html())))
                actualAmount += parseFloat(0);
            else
                actualAmount += parseFloat($("#lbProductDiscountTotal").html());

            if (isNaN(parseFloat($("#lbDiscountTotal").html())))
                totalAmount += parseFloat(0);
            else
                totalAmount += parseFloat($("#lbDiscountTotal").html());

            if (isNaN(parseFloat($("#lbTuitionItemTotal").html())))
                totalAmount += parseFloat(0);
            else
                totalAmount += parseFloat($("#lbTuitionItemTotal").html());

            if (isNaN(parseFloat($("#lbProductTotal").html())))
                totalAmount += parseFloat(0);
            else
                totalAmount += parseFloat($("#lbProductTotal").html());

            $("#tbTotalAmount").val(Number(actualAmount).toFixed(2));
            $("#tbActualAmount").val(Number(actualAmount).toFixed(2));

        }
        $(function () {
            $(".tbTuitionItemDiscount").live("change", function () {
                var tuitionItemGuid = $(this).parent().parent().children().eq(5).find("input[name='hfTuitionItemGuid']").val();
                var dis = $(this).val();
                if (isNaN(dis)) {
                    dis = "1.00";
                }
                else {
                    if (Number(dis) <= 0 || Number(dis) > 1)
                        dis = "1.00";
                }
                if ($("#hfTuitionItemData").val() != "") {
                    jsonItemList = jQuery.parseJSON($("#hfTuitionItemData").val());
                    for (i = 0; i < jsonItemList.length; i++) {
                        if (jsonItemList[i].TuitionItemGuid.toLocaleLowerCase() == tuitionItemGuid.toLocaleLowerCase()) {
                            jsonItemList[i].Discount = dis;
                            jsonItemList[i].ActualAmount = (Number(jsonItemList[i].SumAmount) * Number(jsonItemList[i].Discount)).toFixed(2);
                        }
                    }
                    $("#hfTuitionItemData").val(JSON.stringify(jsonItemList));
                    BindItem();
                    ItemAutoCompute();
                }
            });
            $(".deleteTuitionItem").live("click", function () {
                var tuitionItemGuid = $(this).parent().parent().children().eq(5).find("input[name='hfTuitionItemGuid']").val();

                if ($("#hfTuitionItemData").val() != "") {
                    jsonItemList = jQuery.parseJSON($("#hfTuitionItemData").val());
                    for (i = 0; i < jsonItemList.length; i++) {
                        if (jsonItemList[i].TuitionItemGuid.toLocaleLowerCase() == tuitionItemGuid.toLocaleLowerCase()) {
                            jsonItemList.splice(i, 1);
                        }
                    }
                    $("#hfTuitionItemData").val(JSON.stringify(jsonItemList));
                    BindItem();
                    ItemAutoCompute();
                }
            });
            $(".tbTuitionItemAmount").live("change", function () {
                var tuitionItemGuid = $(this).parent().parent().children().eq(5).find("input[name='hfTuitionItemGuid']").val();
                var itemAmount = $(this).val();
                if (isNaN(itemAmount)) {
                    itemAmount = "0.00";
                }
                var itemDiscount = Number($(this).parent().parent().children().eq(2).find("input").val());

                if ($("#hfTuitionItemData").val() != "") {
                    jsonItemList = jQuery.parseJSON($("#hfTuitionItemData").val());
                    for (i = 0; i < jsonItemList.length; i++) {
                        if (jsonItemList[i].TuitionItemGuid.toLocaleLowerCase() == tuitionItemGuid.toLocaleLowerCase()) {
                            jsonItemList[i].ItemAmount = itemAmount;
                            jsonItemList[i].ActualAmount = Number(itemAmount * itemDiscount).toFixed(2);

                        }
                    }
                    $("#hfTuitionItemData").val(JSON.stringify(jsonItemList));
                    BindItem();
                    ItemAutoCompute();
                }
            });
        });

        function selectLesson(navId) {
            window.parent.showDialog("选择教育科目", "../Modules/Teach/SelectLikeLesson.aspx?navId=" + navId, "500px", "420px");
        }
        function AddLikeLessonInfo(Items) {
            if (Items != null && Items != "") {
                var discount = "1.00";
                if ($.trim($("#txtDiscount").val()) != "")
                    discount = $.trim($("#txtDiscount").val());

                var hfInfo = $("#hfLessonData").val();
                if (hfInfo != "") {
                    jsonObjList = jQuery.parseJSON(hfInfo);
                }
                else {
                    jsonObjList = [];
                }
                var jsonItemList = jQuery.parseJSON(Items);

                var isExist = false;
                for (var i = 0; i < jsonObjList.length; i++) {
                    if (jsonObjList[i].LessonGuid.toLocaleLowerCase() == jsonItemList[0].LikeLessonGuid.toLocaleLowerCase()) {
                        isExist = true;
                    }
                }
                if (isExist) {
                    parent.parent.ShowTips("该兴趣课已添加");
                }
                else {
                    if (jsonItemList[0].IsDiscount == "True" || jsonItemList[0].IsDiscount == "true" || jsonItemList[0].IsDiscount == "1") {
                        jsonObjList.push({ MemberTuitionLessonGuid: "00000000-0000-0000-0000-000000000000", MemberTuitionGuid: "00000000-0000-0000-0000-000000000000", LessonGuid: jsonItemList[0].LikeLessonGuid, LessonName: jsonItemList[0].LikeLessonName, LessonPrice: jsonItemList[0].LikeLessonPrice, SumAmount: (Number(jsonItemList[0].LikeLessonPrice)).toFixed(2), Discount: discount, ActualAmount: (Number(jsonItemList[0].LikeLessonPrice) * (Number(discount))).toFixed(2), IsDiscount: jsonItemList[0].IsDiscount });
                    }
                    else {
                        jsonObjList.push({ MemberTuitionLessonGuid: "00000000-0000-0000-0000-000000000000", MemberTuitionGuid: "00000000-0000-0000-0000-000000000000", LessonGuid: jsonItemList[0].LikeLessonGuid, LessonName: jsonItemList[0].LikeLessonName, LessonPrice: jsonItemList[0].LikeLessonPrice, SumAmount: (Number(jsonItemList[0].LikeLessonPrice)).toFixed(2), Discount: "1.00", ActualAmount: (Number(jsonItemList[0].LikeLessonPrice) * (Number(1.00))).toFixed(2), IsDiscount: jsonItemList[0].IsDiscount });
                    }

                    $("#hfLessonData").val(JSON.stringify(jsonObjList));
                    BindLesson();
                    parent.parent.ShowTips("添加成功");
                }

            }

        }
        function BindLesson() {
            var hfInfo = $("#hfLessonData").val();
            if (hfInfo != "") {
                jsonItemList = jQuery.parseJSON(hfInfo);
            }
            else {
                jsonItemList = [];
            }
            var trHtml = '';
            for (i = 0; i < jsonItemList.length; i++) {
                trHtml += '<tr>';
                trHtml += '<td>' + jsonItemList[i].LessonName + '</td>';
                trHtml += '<td style="text-align:right;">' + (Number(jsonItemList[i].LessonPrice)).toFixed(2) + '</td>';
                if (jsonItemList[i].IsDiscount.toString() == "True" || jsonItemList[i].IsDiscount.toString() == "true" || jsonItemList[i].IsDiscount.toString() == "1") {

                    trHtml += '<td><input type="text" name="tbDiscountTrue" value="' + (Number(jsonItemList[i].Discount)).toFixed(2) + '" class="int tbLessonDiscount" style="width:60px;text-align:right;" /></td>';
                }
                else {
                    trHtml += '<td><input type="text" name="tbDiscount" disabled="true" value="' + (Number(jsonItemList[i].Discount)).toFixed(2) + '" class="int" style="width:60px;text-align:right;" /></td>';
                }
                trHtml += '<td style="text-align:right;"><input type="text" name="tbLessonSumAmount" class="int tbLessonSumAmount" value="' + jsonItemList[i].SumAmount + '" style="width:60px;text-align:right;"/></td>';
                trHtml += '<td style="text-align:right;">' + jsonItemList[i].ActualAmount + '</td>';
                trHtml += '<td><a href="javascript:void(0)" title="删除" class="deleteLesson"><img src="../../Images/del_c.png" /></a>';
                trHtml += '<input type="hidden" name="hfLessonGuid" value=\'' + jsonItemList[i].LessonGuid + '\' />';
                trHtml += '</td>';
                trHtml += '</tr>';
            }
            $("#lessonList tbody").html(trHtml);
            LessonAutoCompute();
        }
        function LessonAutoCompute() {
            var subTotal = 0, discountSubTotal = 0;
            $("#lessonList tbody tr").each(function () {
                var itemAmount = Number($(this).children().eq(3).find("input").val());
                var itemDiscount = Number($(this).children().eq(2).find("input").val());
                $(this).children().eq(4).text((itemAmount * itemDiscount).toFixed(2));
                subTotal += itemAmount;
                discountSubTotal += itemAmount * itemDiscount;
            });
            $("#lbLessonTotal").text(subTotal.toFixed(2));
            $("#lbLessonDiscountTotal").text(discountSubTotal.toFixed(2));
            ColAmount();
            ReSizeScrollbar();
        }
        $(function () {
            $(".tbLessonDiscount").live("change", function () {
                var lessonGuid = $(this).parent().parent().children().eq(5).find("input[name='hfLessonGuid']").val();
                var dis = $(this).val();
                if (isNaN(dis)) {
                    dis = "1.00";
                }
                else {
                    if (Number(dis) <= 0 || Number(dis) > 1)
                        dis = "1.00";
                }
                if ($("#hfLessonData").val() != "") {
                    jsonItemList = jQuery.parseJSON($("#hfLessonData").val());
                    for (var i = 0; i < jsonItemList.length; i++) {
                        if (jsonItemList[i].LessonGuid.toLocaleLowerCase() == lessonGuid.toLocaleLowerCase()) {
                            jsonItemList[i].Discount = dis;
                            jsonItemList[i].ActualAmount = (Number(jsonItemList[i].SumAmount) * Number(jsonItemList[i].Discount)).toFixed(2);
                        }
                    }
                    $("#hfLessonData").val(JSON.stringify(jsonItemList));
                    BindLesson();
                }
            });
            $(".tbLessonSumAmount").live("change", function () {
                var lessonGuid = $(this).parent().parent().children().eq(5).find("input[name='hfLessonGuid']").val();
                var lessonSumAmount = $(this).val();
                if (isNaN(lessonSumAmount)) {
                    lessonSumAmount = "0.00";
                }
                var lessonDiscount = Number($(this).parent().parent().children().eq(2).find("input").val());

                if ($("#hfLessonData").val() != "") {
                    jsonItemList = jQuery.parseJSON($("#hfLessonData").val());
                    for (i = 0; i < jsonItemList.length; i++) {
                        if (jsonItemList[i].LessonGuid.toLocaleLowerCase() == lessonGuid.toLocaleLowerCase()) {
                            jsonItemList[i].SumAmount = lessonSumAmount;
                            jsonItemList[i].ActualAmount = Number(lessonSumAmount * lessonDiscount).toFixed(2);

                        }
                    }
                    $("#hfLessonData").val(JSON.stringify(jsonItemList));
                    BindLesson();
                }

            });
            $(".deleteLesson").live("click", function () {
                var lessonGuid = $(this).parent().parent().children().eq(5).find("input[name='hfLessonGuid']").val();
                if ($("#hfLessonData").val() != "") {
                    jsonItemList = jQuery.parseJSON($("#hfLessonData").val());
                    for (var i = 0; i < jsonItemList.length; i++) {
                        if (jsonItemList[i].LessonGuid.toLocaleLowerCase() == lessonGuid.toLocaleLowerCase()) {
                            jsonItemList.splice(i, 1);
                        }
                    }
                    $("#hfLessonData").val(JSON.stringify(jsonItemList));
                    BindLesson();
                }
            });
        });


        function selectProduct(navId) {
            window.parent.showDialog("选择物品", "../Modules/Asset/SelectInventory.aspx?navId=" + navId + "&act=1", "800px", "500px");
        }
        function AddProduct_Mult(Items) {
            if (Items != null && Items != "") {
                var discount = "1.00";
                if ($.trim($("#txtDiscount").val()) != "")
                    discount = $.trim($("#txtDiscount").val());

                var hfInfo = $("#hfProductData").val();
                if (hfInfo != "") {
                    jsonObjList = jQuery.parseJSON(hfInfo);
                }
                else {
                    jsonObjList = [];
                }
                var jsonItemList = jQuery.parseJSON(Items);
                var isExist = false;

                for (var i = 0; i < jsonItemList.length; i++) {
                    isExist = false;
                    for (var j = 0; j < jsonObjList.length; j++) {
                        if (jsonObjList[j].ProductGuid.toLocaleLowerCase() == jsonItemList[i].ProductGuid.toLocaleLowerCase()) {
                            isExist = true;
                        }
                    }
                    if (!isExist) {
                        jsonObjList.push({ MemberTuitionLessonGuid: "00000000-0000-0000-0000-000000000000", MemberTuitionGuid: "00000000-0000-0000-0000-000000000000", ProductGuid: jsonItemList[i].ProductGuid, ProductPrice: jsonItemList[i].SalePrice, ProductName: jsonItemList[i].ProductName, ProductCount: 1, GiftCount: 1, Discount: discount, SumAmount: (Number(jsonItemList[i].SalePrice)).toFixed(2), ActualAmount: (Number(jsonItemList[i].SalePrice) * (Number(discount))).toFixed(2), InventoryGuid: jsonItemList[i].InventoryGuid });
                    }

                }
                $("#hfProductData").val(JSON.stringify(jsonObjList));
                BindProduct();
                parent.parent.ShowTips("添加成功");
            }

        }



        function AddProduct(Items) {
            if (Items != null && Items != "") {
                var discount = "1.00";
                if ($.trim($("#txtDiscount").val()) != "")
                    discount = $.trim($("#txtDiscount").val());

                var hfInfo = $("#hfProductData").val();
                if (hfInfo != "") {
                    jsonObjList = jQuery.parseJSON(hfInfo);
                }
                else {
                    jsonObjList = [];
                }
                var jsonItemList = jQuery.parseJSON(Items);

                var isExist = false;
                for (var i = 0; i < jsonObjList.length; i++) {
                    if (jsonObjList[i].ProductGuid.toLocaleLowerCase() == jsonItemList[0].ProductGuid.toLocaleLowerCase()) {
                        isExist = true;
                    }
                }
                if (isExist) {
                    parent.parent.ShowTips("该物品已添加");
                }
                else {

                    jsonObjList.push({ MemberTuitionLessonGuid: "00000000-0000-0000-0000-000000000000", MemberTuitionGuid: "00000000-0000-0000-0000-000000000000", ProductGuid: jsonItemList[0].ProductGuid, ProductPrice: jsonItemList[0].SalePrice, ProductName: jsonItemList[0].ProductName, ProductCount: 1, GiftCount: 1, Discount: discount, SumAmount: (Number(jsonItemList[0].SalePrice)).toFixed(2), ActualAmount: (Number(jsonItemList[0].SalePrice) * (Number(discount))).toFixed(2), InventoryGuid: jsonItemList[0].InventoryGuid });


                    $("#hfProductData").val(JSON.stringify(jsonObjList));
                    BindProduct();
                    parent.parent.ShowTips("添加成功");
                }

            }

        }
        function BindProduct() {
            var hfInfo = $("#hfProductData").val();
            if (hfInfo != "") {
                jsonItemList = jQuery.parseJSON(hfInfo);
            }
            else {
                jsonItemList = [];
            }
            var trHtml = '';
            for (i = 0; i < jsonItemList.length; i++) {
                trHtml += '<tr>';
                trHtml += '<td>' + jsonItemList[i].ProductName + '</td>';
                trHtml += '<td style="text-align:right;">' + (Number(jsonItemList[i].ProductPrice)).toFixed(2) + '</td>';


                trHtml += '<td style="text-align:center;"><input class="int tbProductCount" value="' + jsonItemList[i].ProductCount + '" style="width:60px;text-align:right;" /></td>';
                trHtml += '<td style="text-align:center;"><input class="int tbGiftCount" value="' + jsonItemList[i].GiftCount + '" style="width:60px;text-align:right;" /></td>';
                trHtml += '<td><input type="text" name="tbDiscountTrue" value="' + (Number(jsonItemList[i].Discount)).toFixed(2) + '" class="int tbProductDiscount" style="width:60px;text-align:right;" /></td>';
                trHtml += '<td style="text-align:right;"><input type="text" name="tbProductSumAmount" class="int tbProductSumAmount" value="' + (Number(jsonItemList[i].SumAmount)).toFixed(2) + '" style="width:60px;text-align:right;"/></td>';

                trHtml += '<td style="text-align:right;">' + (Number(jsonItemList[i].ActualAmount)).toFixed(2) + '</td>';
                trHtml += '<td><a href="javascript:void(0)" title="删除" class="deleteProduct"><img src="../../Images/del_c.png" /></a>';
                trHtml += '<input type="hidden" name="hfProductGuid" value=\'' + jsonItemList[i].ProductGuid + '\' />';
                trHtml += '</td>';
                trHtml += '</tr>';
            }
            $("#ProductList tbody").html(trHtml);
            ProductAutoCompute();
        }
        function ProductAutoCompute() {
            var subTotal = 0, discountSubTotal = 0;
            $("#ProductList tbody tr").each(function () {
                var itemAmount = Number($(this).children().eq(5).find("input").val());
                var itemDiscount = Number($(this).children().eq(4).find("input").val());
                $(this).children().eq(6).text((itemAmount * itemDiscount).toFixed(2));
                subTotal += itemAmount;
                discountSubTotal += itemAmount * itemDiscount;
            });
            $("#lbProductTotal").text(subTotal.toFixed(2));
            $("#lbProductDiscountTotal").text(discountSubTotal.toFixed(2));
            ColAmount();
            ReSizeScrollbar();
        }
        $(function () {
            $(".tbProductCount").live("change", function () {
                var productGuid = $(this).parent().parent().children().eq(7).find("input[name='hfProductGuid']").val();
                var productCount = $(this).val();
                if (isNaN($(this).val())) {
                    productCount = "1.00";
                }
                else {
                    if (Number($(this).val()) < 0)
                        productCount = "1.00";
                }
                if ($("#hfProductData").val() != "") {
                    jsonItemList = jQuery.parseJSON($("#hfProductData").val());
                    for (i = 0; i < jsonItemList.length; i++) {
                        if (jsonItemList[i].ProductGuid.toLocaleLowerCase() == productGuid.toLocaleLowerCase()) {
                            jsonItemList[i].ProductCount = productCount;
                            jsonItemList[i].SumAmount = ((Number(productCount)) * Number(jsonItemList[i].ProductPrice)).toFixed(2);
                            jsonItemList[i].ActualAmount = (Number(jsonItemList[i].SumAmount) * Number(jsonItemList[i].Discount)).toFixed(2);
                        }
                    }
                    $("#hfProductData").val(JSON.stringify(jsonItemList));
                    BindProduct();
                }
            });
            $(".tbGiftCount").live("change", function () {
                var productGuid = $(this).parent().parent().children().eq(7).find("input[name='hfProductGuid']").val();
                var giftCount = $(this).val();
                if (isNaN($(this).val())) {
                    giftCount = "1.00";
                }
                else {
                    if (Number($(this).val()) < 0)
                        giftCount = "1.00";
                }
                if ($("#hfProductData").val() != "") {
                    jsonItemList = jQuery.parseJSON($("#hfProductData").val());
                    for (i = 0; i < jsonItemList.length; i++) {
                        if (jsonItemList[i].ProductGuid.toLocaleLowerCase() == productGuid.toLocaleLowerCase()) {
                            jsonItemList[i].GiftCount = giftCount;
                            jsonItemList[i].SumAmount = (Number(jsonItemList[i].ProductCount)) * Number(jsonItemList[i].ProductPrice).toFixed(2);
                            jsonItemList[i].ActualAmount = (Number(jsonItemList[i].SumAmount) * Number(jsonItemList[i].Discount)).toFixed(2);
                        }
                    }
                    $("#hfProductData").val(JSON.stringify(jsonItemList));
                    BindProduct();
                }
            });
            $(".tbProductDiscount").live("change", function () {
                var productGuid = $(this).parent().parent().children().eq(7).find("input[name='hfProductGuid']").val();
                var dis = $(this).val();
                if (isNaN(dis)) {
                    dis = "1.00";
                }
                else {
                    if (Number(dis) <= 0 || Number(dis) > 1)
                        dis = "1.00";
                }
                if ($("#hfProductData").val() != "") {
                    jsonItemList = jQuery.parseJSON($("#hfProductData").val());
                    for (i = 0; i < jsonItemList.length; i++) {
                        if (jsonItemList[i].ProductGuid.toLocaleLowerCase() == productGuid.toLocaleLowerCase()) {
                            jsonItemList[i].Discount = dis;
                            //jsonItemList[i].SumAmount = (Number(jsonItemList[i].ProductCount)) * Number(jsonItemList[i].ProductPrice).toFixed(2);
                            jsonItemList[i].ActualAmount = (Number(jsonItemList[i].SumAmount) * Number(jsonItemList[i].Discount)).toFixed(2);
                        }
                    }
                    $("#hfProductData").val(JSON.stringify(jsonItemList));
                    BindProduct();
                }
            });
            $(".deleteProduct").live("click", function () {
                var productGuid = $(this).parent().parent().children().eq(7).find("input[name='hfProductGuid']").val();
                if ($("#hfProductData").val() != "") {
                    jsonItemList = jQuery.parseJSON($("#hfProductData").val());
                    for (i = 0; i < jsonItemList.length; i++) {
                        if (jsonItemList[i].ProductGuid.toLocaleLowerCase() == productGuid.toLocaleLowerCase()) {
                            jsonItemList.splice(i, 1);
                        }
                    }
                    $("#hfProductData").val(JSON.stringify(jsonItemList));
                    BindProduct();
                }
            });
            $(".tbProductSumAmount").live("change", function () {
                var productGuid = $(this).parent().parent().children().eq(7).find("input[name='hfProductGuid']").val();
                var productSumAmount = $(this).val();
                if (isNaN(productSumAmount)) {
                    productSumAmount = "0.00";
                }
                var productDiscount = Number($(this).parent().parent().children().eq(4).find("input").val());

                if ($("#hfProductData").val() != "") {
                    jsonItemList = jQuery.parseJSON($("#hfProductData").val());
                    for (i = 0; i < jsonItemList.length; i++) {
                        if (jsonItemList[i].ProductGuid.toLocaleLowerCase() == productGuid.toLocaleLowerCase()) {
                            jsonItemList[i].SumAmount = productSumAmount;
                            jsonItemList[i].ActualAmount = Number(productSumAmount * productDiscount).toFixed(2);

                        }
                    }
                    $("#hfProductData").val(JSON.stringify(jsonItemList));
                    BindProduct();
                }
            });
        });

        $(function () {
            $("#txtDiscount").live("change", function () {
                var dis = $(this).val();
                if (isNaN(dis)) {
                    dis = "1.00";
                }
                else {
                    if (Number(dis) <= 0 || Number(dis) > 1)
                        dis = "1.00";
                }
                $(this).val(Number(dis).toFixed(2));
                var jsonItemList;
                if ($("#hfProductData").val() != "") {
                    jsonItemList = jQuery.parseJSON($("#hfProductData").val());
                    for (i = 0; i < jsonItemList.length; i++) {
                        jsonItemList[i].Discount = Number(dis).toFixed(2);
                        jsonItemList[i].ActualAmount = (Number(jsonItemList[i].SumAmount) * Number(jsonItemList[i].Discount) * (Number(jsonItemList[i].ProductCount))).toFixed(2);
                    }
                    $("#hfProductData").val(JSON.stringify(jsonItemList));
                    BindProduct();
                }

                if ($("#hfLessonData").val() != "") {
                    jsonItemList = jQuery.parseJSON($("#hfLessonData").val());
                    for (i = 0; i < jsonItemList.length; i++) {
                        if (jsonItemList[i].IsDiscount == "True" || jsonItemList[i].IsDiscount == "true" || jsonItemList[i].IsDiscount == "1") {
                            jsonItemList[i].Discount = Number(dis).toFixed(2);
                            jsonItemList[i].ActualAmount = (Number(jsonItemList[i].SumAmount) * Number(jsonItemList[i].Discount)).toFixed(2);
                        }
                    }
                    $("#hfLessonData").val(JSON.stringify(jsonItemList));
                    BindLesson();
                }

                if ($("#hfTuitionItemData").val() != "") {
                    jsonItemList = jQuery.parseJSON($("#hfTuitionItemData").val());
                    for (i = 0; i < jsonItemList.length; i++) {
                        if (jsonItemList[i].IsDiscount == "True" || jsonItemList[i].IsDiscount == "true" || jsonItemList[i].IsDiscount == "1") {
                            jsonItemList[i].Discount = Number(dis).toFixed(2);
                            jsonItemList[i].ActualAmount = (Number(jsonItemList[i].ItemAmount) * Number(jsonItemList[i].Discount)).toFixed(2);
                        }
                    }
                    $("#hfTuitionItemData").val(JSON.stringify(jsonItemList));
                    BindItem();
                }
            });
        });

        $(function () {
            //$("#tbTotalAmount").attr("disabled", true);
            if ($("#hfTuitionItemData").val() != "") {
                BindItem();
            }
            if ($("#hfLessonData").val() != "") {
                BindLesson();
            }
            if ($("#hfProductData").val() != "") {
                BindProduct();
            }
            if ($("#hfMember").val() != "") {
                BindMember();
            }
        });
    </script>
    <script type="text/javascript">
        //点击设置，显示添加前缀
        function setContractNum(obj) {
            $("#Ta_fieldExport").css("display", "block");
        }
        //前缀保存后，隐藏修改编码
        function SaveSet() {
            $.AjaxETM("Finance_PrefixAdd", { "PrefixCode": $("#txtFirst").val(), "Type": 1 },
               function (data) {
                   hideSet();
                   if (data != null) {
                       if (data.toLocaleLowerCase() != "false".toLocaleLowerCase()) {
                           var codeNO = $("#PFBillNo").val();
                           //原先 前缀
                           var hftxtFirst = $("#hftxtFirst").val();
                           if (hftxtFirst == "") {
                               $("#PFBillNo").val(data + codeNO + "");
                               $("#hftxtFirst").val(data);
                           }
                           else {
                               var codeNOs = codeNO.substr(0, hftxtFirst.length);
                               //判断 原先前缀 是否在 定金号前缀存在 有则 替换
                               if (codeNOs.toLocaleLowerCase() == hftxtFirst.toLocaleLowerCase()) {
                                   $("#PFBillNo").val(codeNO.replace(codeNOs, data));
                                   $("#hftxtFirst").val(data);
                               }
                               else {
                                   //$("#PFBillNo").val(codeNO.replace(codeNOs, data));
                                   //$("#hftxtFirst").val(data);
                               }
                           }
                       }
                   }
               }, false, "text");
        }
        //编码点击取消，隐藏
        function hideSet() {
            $("#Ta_fieldExport").css("display", "none")
        }
    </script>
    <script type="text/javascript">
        $(function () {
            $(".mouseTips").bind({
                mouseenter: function () {
                    var $offset = $(this).position();
                    $(this).next().css({ "top": ($offset.top + 23) + "px", "left": ($offset.left - 80) + "px" }).show();
                },
                mouseleave: function () {
                    $(this).next().hide();
                }
            });
        });
    </script>
</head>
<body>
    <form method="post" action="TuitionIn_More.aspx?navId=be5af13f-a3ec-4c07-bb79-9cd73b912f13" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__LASTFOCUS" id="__LASTFOCUS" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTY2OTM1MDkyMg9kFgICAw9kFgoCBA8QZBAVCAnor7fpgInmi6kJ6IiS5aSn5rO9BGRlbW8G5p2O5qKFBue6ouiMtgbog6HmnaUG6IOh6ZSmBndhbmRvdRUIJDAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMCQzODkxMGZjZi1hOWFmLTQyYzEtYjQ1MC0yZjBjMzM0YjI3Y2YkMzZiZGVlMjAtNjAxNi00ZjRlLWEyOTAtNTgyYzExNDNhNWI3JDY1NjcxZTczLWY5ZDAtNDU0NS05M2ZmLThiODE3Y2FkODgwZiRkNmZiMjgyYi1lNDcyLTQ0OWYtYjJjNS1jMmJjOTVjYzRhYjUkM2VkYzkzOWEtMGU0MC00MGQwLWEyMTEtZmY3ZWQwZTQ2MmQ4JGJhYWE1YWY1LTAyZDgtNDZiZS1iNTRkLWRiMjllYWVjMDkwZCRjNzEwYTBhZS0xZmRjLTQ1OGYtYTcwNS02NzY0ODFkY2IyZjAUKwMIZ2dnZ2dnZ2dkZAIGDxBkEBUECeivt+mAieaLqRvlu7rooYwgNjIyMjAyMjAgMTUwMDEzNzAwMTIZ546w6YeR5pSv5LuYIOeOsOmHkeaUr+S7mBjmlK/ku5jlrp0gMTIzNDg5NDc0ODk3ODQVBCQwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAkNDlhYWI1NTgtYjMxMC00MjE5LTk2ZWQtYWIxOTkxNTFjZTE1JGZlMzBlYTMyLTgzNDAtNGMwNi1iZGFjLWVhZWEyODU2NDI0YiQ5YjFkZWIyNC04ZGEzLTQ4NjAtYTNhMC00ZGEwNTNlYzE5NjAUKwMEZ2dnZ2RkAggPEGQQFQIJ6K+36YCJ5oupDOWcqOWbreW5vOWEvxUCJDAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMCRmNjU2MjY5My02NzdhLTRkNjItYTMwMy1hMDYzMjA4ODNjNjAUKwMCZ2dkZAIRDxBkEBUFCeivt+mAieaLqQ0yMDE45LiK5a2m5pyfDTIwMTfkuIvlrabmnJ8NMjAxN+S4iuWtpuacnw0yMDE25LiL5a2m5pyfFQUkMDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAwJGY3NzVjOWY2LTE5ZDUtNGMxYi04ZDE5LWEzNmE0NGIxY2RjNSQ5ODgwZGRkYi1kODIyLTQ2NTItOTc2ZS04ZGI1NTAzYWU1NGUkNjlkYjhlNjItZmFlNi00MjZkLTliYjItODA2OTM2NzE4OTBlJGQwZTU5ZmQ2LTYxNzEtNGI4ZS1hZjY4LTBlZWQ5OWY1ZGI4ZRQrAwVnZ2dnZxYBZmQCEg8QZBAVDAnor7fpgInmi6kJMjAxMH4yMDExCTIwMTF+MjAxMgkyMDEyfjIwMTMJMjAxM34yMDE0CTIwMTR+MjAxNQkyMDE1fjIwMTYJMjAxNn4yMDE3CTIwMTd+MjAxOAkyMDE4fjIwMTkJMjAxOX4yMDIwCTIwMjB+MjAyMRUMJDAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMAkyMDEwfjIwMTEJMjAxMX4yMDEyCTIwMTJ+MjAxMwkyMDEzfjIwMTQJMjAxNH4yMDE1CTIwMTV+MjAxNgkyMDE2fjIwMTcJMjAxN34yMDE4CTIwMTh+MjAxOQkyMDE5fjIwMjAJMjAyMH4yMDIxFCsDDGdnZ2dnZ2dnZ2dnZxYBZmQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgcFDHJkYlRpbWVTdGVwTQUMcmRiVGltZVN0ZXBUBQxyZGJUaW1lU3RlcFQFDHJkYlRpbWVTdGVwWQUMcmRiVGltZVN0ZXBZBQpja2JEZXBvc2l0BQZja2JZdUXe+CNrBWC7vZ5fhLReYhiNaCgpaYCgWvHHjHp+kL4eDA==" />
</div>

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>


<div class="aspNetHidden">

	<input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="F7ADEB66" />
	<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEdACdXCb+/8FMy9qw7UG7ko3pq9jcZefH9/k8OaHJ+tw8UEvKYEfo9OOGH7sdQDX0GZ4AIXUwnZZ5ZY9cMa/RSlzAEjkzo1uOKwfeZnATKYaq7+/9Xn+5FVQTQXL+dJ2sukAQP0bd69A1C9FWkc6m7QFQIsNyIUDJYfWiHpstI/DHJfhQ+Jtey1lRA5tXTtVlXsedVMn53XavdcagPO3C+tcunuGGFLvQZHWvf0w2buy05JUmSmf5KFBC37rA18b3s8E4TrVu9JjtG4DL/OU9RMtbUduKg8OjMEzkEZdeI7GNgkrt+eAUYRrt0pBZb/DuqHw4iwasz+Vj8Sz8wc874dk5eMOaCMIpv1ztV3kfg7cmxcp0GOvZ99pn1SuW+kgd0KyM0begnwv9UoIKUiHkJvH7tNn/rDe0BPnc8rP3Cnwp9050IQTmtbCYy3dwsEfamyUVQnrtVoOBxIMeRe7vpY/eYoTa4oblvTLITfnqQsayP/3e9oXOYBsC5fnVDOyiGcorxilq0Ru5aQc5TvsdR6nzedkWXFk7dHh3NyrmJy6DkAROkFaoTZ77m/2oRGwxikOwbWjucypPzjzm6d2Q6WcAiyq3/ei4j2ILgyIZhNzTl1xem0sbKZFqvuEbbeV/rXRTbn1K1oMvsQu3eByOplcv/KHGW3iCxpnFPVxZxejGojCufJrsj375WGMkeZIiZmnjHR1lyU4bZoXuKR0PFH5xdHenBj4F38DDySsDomsvcBNON2OMzGO7Z6sbnXTNqTX3tKzbJp76LLDKRl8KXZvp73V6SPz+9gGZjc495Vpi545ZYgDymPir0Zp4mFYzbkIhqPTlJmNi4fEClDDVdsLXSWoVAb1TBKPhM3TpEaIuN7A==" />
</div>
          <script src="../../Scripts/jQuery.etmRightLinks.js"></script><script src="../../Scripts/jQuery.etmTabs.js"></script><script type="text/javascript">$(function () {$("#rightLinks").etmTabs({item: [{ Text: "收费登记", Url: "../../Modules/Finance/TuitionIn_More.aspx?navId=be5af13f-a3ec-4c07-bb79-9cd73b912f13&pageid=11261b4b-3c64-4396-9872-87f4fdd9d3b5", Selected: true },{ Text: "单据审核", Url: "../../Modules/Finance/TuitionIn_MoreDetailCheck.aspx?navId=be5af13f-a3ec-4c07-bb79-9cd73b912f13&pageid=aa369d51-6557-4b56-b3ca-3c38dedeabf5" },{ Text: "单据列表", Url: "../../Modules/Finance/TuitionInList.aspx?navId=be5af13f-a3ec-4c07-bb79-9cd73b912f13&pageid=9ac304b0-6a26-42ae-b185-00bfeaddd463" },{ Text: "单据汇总", Url: "../../Modules/Finance/TuitionIn_Gather.aspx?navId=be5af13f-a3ec-4c07-bb79-9cd73b912f13&pageid=4bbfbc3d-9658-48a0-8f6a-3238a324ebfd" },{ Text: "详细列表", Url: "../../Modules/Finance/TuitionInHistory.aspx?navId=be5af13f-a3ec-4c07-bb79-9cd73b912f13&pageid=b0ead2f4-7fe4-48ed-84dc-2c9a303a8d22" }]});});</script><div id='rightLinks' style='position: absolute; top: 2px; right: 10px;'></div>
        <table class="edit">
            <tr>
                <td class="textAlignRight">幼儿：</td>
                <td style="padding-top: 0px; position: relative;" colspan="5">
                    <a onclick="selectMember('be5af13f-a3ec-4c07-bb79-9cd73b912f13    ')" href="javascript:void(0)" id="btnAddMember" style="position: absolute; top: 10px;">
                    <img alt="点击添加幼儿" title="点击添加幼儿" src="./home/images/add.png" style="border: 0; vertical-align: middle;" />
                </a>
                    <div id="dvMember" style="margin-left: 20px; "></div>
                    
                    <input type="hidden" name="hfMember" id="hfMember" />
                </td>
            </tr>
            <tr>
                <td class="textAlignRight" style="width: 80px;">编号前缀：</td>
                <td class="borderRight" style="width: 235px;">
                    <input name="PFBillNo" type="text" value="12121" id="PFBillNo" class="int" />
                    <a title="设置合同编号前缀" onclick="setContractNum(this);" href="javascript:void(0)">[设置]</a>
                    &nbsp;<a href="javascript:void(0);" class="mouseTips">[?]</a>
                    <div class="tips" style="display: none;">
                        单据号格式：编号前缀+年月日+4位递增数字
                    </div>
                    <table id="Ta_fieldExport" class="list" style="position: fixed; z-index: 6; width: 340px; display: none" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td colspan="2" style="padding-bottom: 5px;">
                                <div style="text-align: center; padding-top: 10px;">
                                    编号前缀：
                                        <input name="txtFirst" type="text" value="12121" id="txtFirst" class="int" style="width: 92px; text-align: center" />
                                    <input type="hidden" name="hftxtFirst" id="hftxtFirst" value="12121" />
                                </div>
                                <div style="text-align: center; padding-top: 10px; margin-top: 7px;">
                                    <input id="btnSaveSet" class="button" type="button" onclick="SaveSet()" value="保存" />
                                    <input id="btnChance" class="button" type="button" onclick="hideSet()" value="取消" style="cursor: default;" />
                                </div>
                            </td>
	</tr>
</table>

                </td>

                <td class="textAlignRight" style="width: 80px;">经办人：
                </td>
                <td class="borderRight" style="width: 205px;">
                    <select name="ddlTransactor" id="ddlTransactor" class="int">
	<option value="00000000-0000-0000-0000-000000000000">请选择</option>
	<option value="38910fcf-a9af-42c1-b450-2f0c334b27cf">舒大泽</option>
	<option value="36bdee20-6016-4f4e-a290-582c1143a5b7">demo</option>
	<option value="65671e73-f9d0-4545-93ff-8b817cad880f">李梅</option>
	<option value="d6fb282b-e472-449f-b2c5-c2bc95cc4ab5">红茶</option>
	<option value="3edc939a-0e40-40d0-a211-ff7ed0e462d8">胡来</option>
	<option value="baaa5af5-02d8-46be-b54d-db29eaec090d">胡锦</option>
	<option value="c710a0ae-1fdc-458f-a705-676481dcb2f0">wandou</option>

</select>&nbsp;<span class="words">*</span>
                </td>

                <td class="textAlignRight" style="width: 80px">折扣：
                </td>
                <td>
                    <input name="txtDiscount" type="text" value="1.00" id="txtDiscount" class="int" style="text-align: right;" />
                </td>
            </tr>
            <tr>
                <td class="textAlignRight">收费帐号：
                </td>
                <td class="borderRight">
                    <select name="ddlAccount" id="ddlAccount" class="int">
	<option value="00000000-0000-0000-0000-000000000000">请选择</option>
	<option value="49aab558-b310-4219-96ed-ab199151ce15">建行 62220220 15001370012</option>
	<option value="fe30ea32-8340-4c06-bdac-eaea2856424b">现金支付 现金支付</option>
	<option value="9b1deb24-8da3-4860-a3a0-4da053ec1960">支付宝 12348947489784</option>

</select>&nbsp;<span class="words">*</span>
                </td>
                <td class="textAlignRight" style="width: 80px;">收费日期：
                </td>
                <td class="borderRight" style="width: 205px;">
                    <input name="tbChargeDate" type="text" value="2017-03-09" id="tbChargeDate" class="int" onfocus="WdatePicker({dateFmt:&#39;yyyy-MM-dd&#39;,onpicked:function(dp){pickedFuncChar(dp.cal.getNewDateStr());}})" />
                    <span class="words">*</span>
                </td>
                <td class="textAlignRight">幼儿类型：
                </td>
                <td class="borderRight">
                    <select name="ddlMemberType" id="ddlMemberType" class="int">
	<option value="00000000-0000-0000-0000-000000000000">请选择</option>
	<option value="f6562693-677a-4d62-a303-a06320883c60">在园幼儿</option>

</select>&nbsp;<a href="javascript:void(0);" class="mouseTips">[?]</a>
                    <div class="tips" style="display: none;">
                        单据成交后，幼儿的类型修改成此类型,不选则不改变
                    </div>
                </td>
            </tr>
            <tr>

                <td class="textAlignRight">到期日期：</td>
                <td class="borderRight">
                    <input name="tbDueDate" type="text" id="tbDueDate" class="int" onfocus="WdatePicker({dateFmt:&#39;yyyy-MM-dd&#39;})" />
                </td>
                <td class="textAlignRight">应收金额：
                </td>
                <td class="borderRight">
                    <input name="tbTotalAmount" type="text" value="0.00" id="tbTotalAmount" disabled="disabled" class="aspNetDisabled int" style="text-align: right;" />&nbsp;元
                    <input type="hidden" name="hfTotalAmount" id="hfTotalAmount" />
                </td>
                   <td class="textAlignRight">实收金额：
                </td>
                <td class="borderRight">
                    <input name="tbActualAmount" type="text" value="0.00" id="tbActualAmount" class="int" onkeypress="return strNoOnly(event)" style="text-align: right;" />&nbsp;元&nbsp;<span class="words">*</span>
                </td>
            </tr>
         
            <tr>
                <td class="textAlignRight">收费模式：</td>
                <td colspan="5">
                    <input id="rdbTimeStepM" type="radio" name="TimeStepGroup" value="rdbTimeStepM" checked="checked" />按月
                    <input id="rdbTimeStepT" type="radio" name="TimeStepGroup" value="rdbTimeStepT" onclick="javascript:setTimeout(&#39;__doPostBack(\&#39;rdbTimeStepT\&#39;,\&#39;\&#39;)&#39;, 0)" />按学期
                       <input id="rdbTimeStepY" type="radio" name="TimeStepGroup" value="rdbTimeStepY" onclick="javascript:setTimeout(&#39;__doPostBack(\&#39;rdbTimeStepY\&#39;,\&#39;\&#39;)&#39;, 0)" />按年
                        <input name="txtMonth" type="text" value="2017-03" id="txtMonth" class="int" onfocus="WdatePicker({dateFmt:&#39;yyyy-MM&#39;})" style="width:70px;" />
                    
                    
                    &nbsp;<a href="javascript:void(0);" class="mouseTips">[?]</a>
                    <div class="tips" style="display: none;">
                        按学期或按年模式，单据完成后，金额充入幼儿账户；按月模式每个幼儿每月都需制作（出勤结算基于按月模式单据统计预收费用），预先制作按学期或按年模式的单据，请选择“账户扣费”支付方式。
                    </div>
                </td>
            </tr>
            <tr>
                <td class="textAlignRight">支付方式：</td>
                <td colspan="5">
                    <span id="rdlPayMode" class="rdlPayMode"><input id="rdlPayMode_0" type="radio" name="rdlPayMode" value="0" checked="checked" /><label for="rdlPayMode_0">现金支付</label><input id="rdlPayMode_1" type="radio" name="rdlPayMode" value="1" /><label for="rdlPayMode_1">银行代扣</label></span>
                    &nbsp;<a href="javascript:void(0);" class="mouseTips">[?]</a>
                    <div class="tips" style="display: none;">
                        银行代扣：单据将进入银行代扣的流程
                    </div>
                </td>
            </tr>
               <tr>
                <td class="textAlignRight">使用定金：</td>
                <td colspan="5">
                    <input id="ckbDeposit" type="checkbox" name="ckbDeposit" />&nbsp;<a href="javascript:void(0);" class="mouseTips">[?]</a>
                    <div class="tips" style="display: none;">
                        勾选之后，有定金幼儿会使用定金，幼儿实付金额=应收金额-定金金额
                    </div>
                </td>
            </tr>
            <tr>
                <td class="textAlignRight">账户抵扣：
                </td>
                <td class="borderRight" colspan="5">
                    <input id="ckbYuE" type="checkbox" name="ckbYuE" checked="checked" />&nbsp;<a href="javascript:void(0);" class="mouseTips">[?]</a>
                    <div class="tips" style="display: none;">
                        勾选之后，幼儿账户有金额会使用账户金额，幼儿实付金额=应收金额-账户金额
                    </div>
                </td>
            </tr>
            <tr>
                <td class="textAlignRight">备注：
                </td>
                <td colspan="5">
                    <textarea name="tbNotes" rows="2" cols="20" id="tbNotes" class="int" style="width: 752px; height: 47px;">
</textarea>
                </td>
            </tr>
            <tr>
                <td colspan="6" class="borderBottom"></td>
            </tr>
            <tr>
                <td colspan="6" style="padding-left: 20px;">收费科目：<a onclick="selectTuitionItem('be5af13f-a3ec-4c07-bb79-9cd73b912f13    ')" href="javascript:void(0)">
                    <img alt="点击添加收费科目" title="点击添加收费科目" src="./home/images/add.png" style="border: 0; vertical-align: middle;">
                </a>
                    <input type="hidden" name="hfTuitionItemData" id="hfTuitionItemData" />
                </td>
            </tr>
            <tr>
                <td colspan="6">
                    <table id="TuitionItemList" class="list" style="text-align: center;">
                        <thead>
                            <tr>
                                <th style="width: 20%;">科目名称</th>
                                <th style="width: 20%;">价格（元）</th>
                                <th style="width: 20%;">折扣</th>
                                <th style="width: 20%;">小计（元）</th>
                                <th style="width: 10%;">折后小计（元）</th>
                                <th style="width: 100px;">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            
                        </tbody>
                        <tfoot>
                            <tr>
                                <td></td>
                                <td></td>
                                <td style="text-align: right;">总计：</td>
                                <td style="text-align: right;">
                                    <span id="lbTuitionItemTotal"></span>&nbsp;元</td>
                                <td style="text-align: right;">
                                    <span id="lbTuitionItemDiscountTotal"></span>&nbsp;元</td>
                                <td></td>
                            </tr>
                        </tfoot>
                    </table>
                </td>
            </tr>
            <tr>
                <td colspan="6" class="borderBottom"></td>
            </tr>


            <tr>
                <td colspan="6" style="padding-left: 20px;">教育科目：<a onclick="selectLesson('be5af13f-a3ec-4c07-bb79-9cd73b912f13    ')" href="javascript:void(0)">
                    <img alt="点击添加教育科目" title="点击添加教育科目" src="./home/images/add.png" style="border: 0; vertical-align: middle;">
                </a>
                    <input type="hidden" name="hfLessonData" id="hfLessonData" />
                </td>
            </tr>
            <tr>
                <td colspan="6">
                    <table id="lessonList" class="list" style="text-align: center;">
                        <thead>
                            <tr>
                                <th style="width: 20%;">课程名称</th>
                                <th style="width: 20%;">价格（元）</th>
                                <th style="width: 20%;">折扣</th>
                                <th style="width: 20%;">小计（元）</th>
                                <th>折后小计（元）</th>
                                <th style="width: 100px;">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            
                        </tbody>
                        <tfoot>
                            <tr>
                                <td colspan="3" style="text-align: right;">总计：</td>
                                <td style="text-align: right;">
                                    <span id="lbLessonTotal"></span>&nbsp;元</td>
                                <td style="text-align: right;">
                                    <span id="lbLessonDiscountTotal"></span>&nbsp;元</td>
                                <td></td>
                            </tr>
                        </tfoot>
                    </table>
                </td>
            </tr>
            <tr>
                <td colspan="6" class="borderBottom"></td>
            </tr>
            <tr>
                <td colspan="6" style="padding-left: 45px;">物品：<a onclick="selectProduct('be5af13f-a3ec-4c07-bb79-9cd73b912f13    ')" href="javascript:void(0)">
                    <img alt="点击添加物品" title="点击添加物品" src="./home/images/add.png" style="border: 0; vertical-align: middle;">
                </a>
                    <input type="hidden" name="hfProductData" id="hfProductData" />
                </td>
            </tr>
            <tr>
                <td colspan="6">
                    <table id="ProductList" class="list" style="text-align: center;">
                        <thead>
                            <tr>
                                <th>物品名称</th>
                                <th>价格（元）</th>
                                <th>购买数量</th>
                                <th>赠送数量</th>
                                <th>折扣</th>
                                <th>小计（元）</th>
                                <th>折后小计（元）</th>
                                <th style="width: 100px;">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            
                        </tbody>
                        <tfoot>
                            <tr>
                                <td colspan="5" style="text-align: right;">总计：</td>
                                <td style="text-align: right;">
                                    <span id="lbProductTotal"></span>&nbsp;元</td>
                                <td style="text-align: right;">
                                    <span id="lbProductDiscountTotal"></span>&nbsp;元</td>
                                <td></td>
                            </tr>
                        </tfoot>
                    </table>
                </td>
            </tr>
            <tr>
                <td colspan="6" style="text-align: center;">
                    <input type="submit" name="btnSave" value="提 交" onclick="return checkData();" id="btnSave" class="button" />
                </td>
            </tr>
        </table>
        <script type="text/javascript">
            function rbCheck(v) {
                if (v == "M") {
                    $("#spanMonth").show();
                    $("#spanTerm").hide();
                    $("#spanYear").hide();
                }
                else if (v == "T") {
                    $("#spanMonth").hide();
                    $("#spanTerm").show();
                    $("#spanYear").hide();
                }
                else {
                    $("#spanMonth").hide();
                    $("#spanTerm").hide();
                    $("#spanYear").show();
                }
            }
            function checkData() {
               
                if ($.trim($("#hfMember").val()) == "" || $.trim($("#hfMember").val()) == "[]") {
                    alert("请选择幼儿");
                    return false;
                }
                if ($.trim($("#PFBillNo").val()) == "") {
                    alert("编号前缀不能为空");
                    return false;
                }
                if ($("#ddlTransactor").val() == "00000000-0000-0000-0000-000000000000") {
                    alert("请选择经办人");
                    return false;
                }
                if ($.trim($("#tbChargeDate").val()) == "") {
                    alert("请选择收费日期");
                    return false;
                }
                if ($("#ddlAccount").val() == "00000000-0000-0000-0000-000000000000") {
                    alert("请选择收费账号");
                    return false;
                }
                if ($("#rdbTimeStepM").is(':checked')) {
                    if ($("#txtMonth").val() == "") {
                        alert("请填写收费时段的月份");
                        return false;
                    }
                }
                if ($("#rdbTimeStepT").is(':checked')) {
                    if ($("#ddlTerm").val() == "00000000-0000-0000-0000-000000000000") {
                        alert("请填写收费时段的学期");
                        return false;
                    }
                }
                $("#hfTotalAmount").val($("#tbTotalAmount").val());
               
                return true;
            }
        </script>
    </form>
</body>
</html>
